
// app.js
App({
  globalData: {
    userId: null,
    token: null
  },
  onLaunch: function () {

    // 初始化云环境
    wx.cloud.init({
      env: "iscaiwan-evn-8g8bfjrha7ad6279",
      traceUser: true
    })
    
    // 小程序初始化时的操作

    // 从本地存储中读取登录状态
    const userId = wx.getStorageSync('userId');
    const token = wx.getStorageSync('token');
    if (userId && token) {
      this.globalData.userId = userId;
      this.globalData.token = token;
      console.log('App 启动时恢复登录状态');
    }

    
  }
})
